\(\int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx\) [18]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 161 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=-\frac {b c d^2}{12 x^3}-\frac {i b c^2 d^2}{3 x^2}+\frac {3 b c^3 d^2}{4 x}-\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}+\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-\frac {2}{3} i b c^4 d^2 \log (x)-\frac {1}{24} i b c^4 d^2 \log (i-c x)+\frac {17}{24} i b c^4 d^2 \log (i+c x) \]

[Out]

-1/12*b*c*d^2/x^3-1/3*I*b*c^2*d^2/x^2+3/4*b*c^3*d^2/x-1/4*d^2*(a+b*arctan(c*x))/x^4-2/3*I*c*d^2*(a+b*arctan(c*
x))/x^3+1/2*c^2*d^2*(a+b*arctan(c*x))/x^2-2/3*I*b*c^4*d^2*ln(x)-1/24*I*b*c^4*d^2*ln(I-c*x)+17/24*I*b*c^4*d^2*l
n(I+c*x)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {45, 4992, 12, 1816} \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}-\frac {2}{3} i b c^4 d^2 \log (x)-\frac {1}{24} i b c^4 d^2 \log (-c x+i)+\frac {17}{24} i b c^4 d^2 \log (c x+i)+\frac {3 b c^3 d^2}{4 x}-\frac {i b c^2 d^2}{3 x^2}-\frac {b c d^2}{12 x^3} \]

[In]

Int[((d + I*c*d*x)^2*(a + b*ArcTan[c*x]))/x^5,x]

[Out]

-1/12*(b*c*d^2)/x^3 - ((I/3)*b*c^2*d^2)/x^2 + (3*b*c^3*d^2)/(4*x) - (d^2*(a + b*ArcTan[c*x]))/(4*x^4) - (((2*I
)/3)*c*d^2*(a + b*ArcTan[c*x]))/x^3 + (c^2*d^2*(a + b*ArcTan[c*x]))/(2*x^2) - ((2*I)/3)*b*c^4*d^2*Log[x] - (I/
24)*b*c^4*d^2*Log[I - c*x] + ((17*I)/24)*b*c^4*d^2*Log[I + c*x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 1816

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 4992

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((f_.)*(x_))^(m_.)*((d_.) + (e_.)*(x_))^(q_.), x_Symbol] :> With[{u = I
ntHide[(f*x)^m*(d + e*x)^q, x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[SimplifyIntegrand[u/(1 + c^2*x^
2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, q}, x] && NeQ[q, -1] && IntegerQ[2*m] && ((IGtQ[m, 0] && IGtQ[q, 0
]) || (ILtQ[m + q + 1, 0] && LtQ[m*q, 0]))

Rubi steps \begin{align*} \text {integral}& = -\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}+\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-(b c) \int \frac {d^2 \left (-3-8 i c x+6 c^2 x^2\right )}{12 x^4 \left (1+c^2 x^2\right )} \, dx \\ & = -\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}+\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-\frac {1}{12} \left (b c d^2\right ) \int \frac {-3-8 i c x+6 c^2 x^2}{x^4 \left (1+c^2 x^2\right )} \, dx \\ & = -\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}+\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-\frac {1}{12} \left (b c d^2\right ) \int \left (-\frac {3}{x^4}-\frac {8 i c}{x^3}+\frac {9 c^2}{x^2}+\frac {8 i c^3}{x}+\frac {i c^4}{2 (-i+c x)}-\frac {17 i c^4}{2 (i+c x)}\right ) \, dx \\ & = -\frac {b c d^2}{12 x^3}-\frac {i b c^2 d^2}{3 x^2}+\frac {3 b c^3 d^2}{4 x}-\frac {d^2 (a+b \arctan (c x))}{4 x^4}-\frac {2 i c d^2 (a+b \arctan (c x))}{3 x^3}+\frac {c^2 d^2 (a+b \arctan (c x))}{2 x^2}-\frac {2}{3} i b c^4 d^2 \log (x)-\frac {1}{24} i b c^4 d^2 \log (i-c x)+\frac {17}{24} i b c^4 d^2 \log (i+c x) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.06 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.94 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\frac {d^2 \left (-3 a-8 i a c x+6 a c^2 x^2-4 i b c^2 x^2-3 b \arctan (c x)-8 i b c x \arctan (c x)+6 b c^2 x^2 \arctan (c x)-b c x \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-c^2 x^2\right )+6 b c^3 x^3 \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-c^2 x^2\right )-8 i b c^4 x^4 \log (x)+4 i b c^4 x^4 \log \left (1+c^2 x^2\right )\right )}{12 x^4} \]

[In]

Integrate[((d + I*c*d*x)^2*(a + b*ArcTan[c*x]))/x^5,x]

[Out]

(d^2*(-3*a - (8*I)*a*c*x + 6*a*c^2*x^2 - (4*I)*b*c^2*x^2 - 3*b*ArcTan[c*x] - (8*I)*b*c*x*ArcTan[c*x] + 6*b*c^2
*x^2*ArcTan[c*x] - b*c*x*Hypergeometric2F1[-3/2, 1, -1/2, -(c^2*x^2)] + 6*b*c^3*x^3*Hypergeometric2F1[-1/2, 1,
 1/2, -(c^2*x^2)] - (8*I)*b*c^4*x^4*Log[x] + (4*I)*b*c^4*x^4*Log[1 + c^2*x^2]))/(12*x^4)

Maple [A] (verified)

Time = 1.35 (sec) , antiderivative size = 125, normalized size of antiderivative = 0.78

method result size
parts \(a \,d^{2} \left (\frac {c^{2}}{2 x^{2}}-\frac {1}{4 x^{4}}-\frac {2 i c}{3 x^{3}}\right )+b \,d^{2} c^{4} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {2 i \arctan \left (c x \right )}{3 c^{3} x^{3}}+\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{3 c^{2} x^{2}}-\frac {2 i \ln \left (c x \right )}{3}-\frac {1}{12 c^{3} x^{3}}+\frac {3}{4 c x}+\frac {i \ln \left (c^{2} x^{2}+1\right )}{3}+\frac {3 \arctan \left (c x \right )}{4}\right )\) \(125\)
derivativedivides \(c^{4} \left (a \,d^{2} \left (-\frac {1}{4 c^{4} x^{4}}-\frac {2 i}{3 c^{3} x^{3}}+\frac {1}{2 c^{2} x^{2}}\right )+b \,d^{2} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {2 i \arctan \left (c x \right )}{3 c^{3} x^{3}}+\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{3 c^{2} x^{2}}-\frac {2 i \ln \left (c x \right )}{3}-\frac {1}{12 c^{3} x^{3}}+\frac {3}{4 c x}+\frac {i \ln \left (c^{2} x^{2}+1\right )}{3}+\frac {3 \arctan \left (c x \right )}{4}\right )\right )\) \(131\)
default \(c^{4} \left (a \,d^{2} \left (-\frac {1}{4 c^{4} x^{4}}-\frac {2 i}{3 c^{3} x^{3}}+\frac {1}{2 c^{2} x^{2}}\right )+b \,d^{2} \left (-\frac {\arctan \left (c x \right )}{4 c^{4} x^{4}}-\frac {2 i \arctan \left (c x \right )}{3 c^{3} x^{3}}+\frac {\arctan \left (c x \right )}{2 c^{2} x^{2}}-\frac {i}{3 c^{2} x^{2}}-\frac {2 i \ln \left (c x \right )}{3}-\frac {1}{12 c^{3} x^{3}}+\frac {3}{4 c x}+\frac {i \ln \left (c^{2} x^{2}+1\right )}{3}+\frac {3 \arctan \left (c x \right )}{4}\right )\right )\) \(131\)
risch \(-\frac {i b \,d^{2} \left (6 c^{2} x^{2}-8 i c x -3\right ) \ln \left (i c x +1\right )}{24 x^{4}}+\frac {i d^{2} \left (17 b \,c^{4} \ln \left (-99 c x -99 i\right ) x^{4}-b \,c^{4} \ln \left (45 c x -45 i\right ) x^{4}-16 b \,c^{4} \ln \left (-165 c x \right ) x^{4}+6 x^{2} b \ln \left (-i c x +1\right ) c^{2}-18 i b \,c^{3} x^{3}-8 b \,c^{2} x^{2}-12 i a \,c^{2} x^{2}-16 c x a -8 i b c x \ln \left (-i c x +1\right )-3 b \ln \left (-i c x +1\right )+2 i b c x +6 i a \right )}{24 x^{4}}\) \(179\)
parallelrisch \(\frac {4 i c^{4} b \,d^{2} \ln \left (c^{2} x^{2}+1\right ) x^{4}-8 i c^{4} b \,d^{2} \ln \left (x \right ) x^{4}+4 i x^{4} b \,c^{4} d^{2}+9 x^{4} \arctan \left (c x \right ) b \,c^{4} d^{2}-6 a \,c^{4} d^{2} x^{4}+9 b \,c^{3} d^{2} x^{3}-4 i x^{2} b \,c^{2} d^{2}+6 x^{2} \arctan \left (c x \right ) b \,c^{2} d^{2}-8 i x \arctan \left (c x \right ) b c \,d^{2}+6 x^{2} d^{2} c^{2} a -8 i a c \,d^{2} x -b c \,d^{2} x -3 b \arctan \left (c x \right ) d^{2}-3 a \,d^{2}}{12 x^{4}}\) \(185\)

[In]

int((d+I*c*d*x)^2*(a+b*arctan(c*x))/x^5,x,method=_RETURNVERBOSE)

[Out]

a*d^2*(1/2*c^2/x^2-1/4/x^4-2/3*I*c/x^3)+b*d^2*c^4*(-1/4*arctan(c*x)/c^4/x^4-2/3*I*arctan(c*x)/c^3/x^3+1/2/c^2/
x^2*arctan(c*x)-1/3*I/c^2/x^2-2/3*I*ln(c*x)-1/12/c^3/x^3+3/4/c/x+1/3*I*ln(c^2*x^2+1)+3/4*arctan(c*x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 155, normalized size of antiderivative = 0.96 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\frac {-16 i \, b c^{4} d^{2} x^{4} \log \left (x\right ) + 17 i \, b c^{4} d^{2} x^{4} \log \left (\frac {c x + i}{c}\right ) - i \, b c^{4} d^{2} x^{4} \log \left (\frac {c x - i}{c}\right ) + 18 \, b c^{3} d^{2} x^{3} + 4 \, {\left (3 \, a - 2 i \, b\right )} c^{2} d^{2} x^{2} - 2 \, {\left (8 i \, a + b\right )} c d^{2} x - 6 \, a d^{2} + {\left (6 i \, b c^{2} d^{2} x^{2} + 8 \, b c d^{2} x - 3 i \, b d^{2}\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{24 \, x^{4}} \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x))/x^5,x, algorithm="fricas")

[Out]

1/24*(-16*I*b*c^4*d^2*x^4*log(x) + 17*I*b*c^4*d^2*x^4*log((c*x + I)/c) - I*b*c^4*d^2*x^4*log((c*x - I)/c) + 18
*b*c^3*d^2*x^3 + 4*(3*a - 2*I*b)*c^2*d^2*x^2 - 2*(8*I*a + b)*c*d^2*x - 6*a*d^2 + (6*I*b*c^2*d^2*x^2 + 8*b*c*d^
2*x - 3*I*b*d^2)*log(-(c*x + I)/(c*x - I)))/x^4

Sympy [A] (verification not implemented)

Time = 8.59 (sec) , antiderivative size = 275, normalized size of antiderivative = 1.71 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=- \frac {2 i b c^{4} d^{2} \log {\left (1485 b^{2} c^{9} d^{4} x \right )}}{3} - \frac {i b c^{4} d^{2} \log {\left (1485 b^{2} c^{9} d^{4} x - 1485 i b^{2} c^{8} d^{4} \right )}}{24} + \frac {17 i b c^{4} d^{2} \log {\left (1485 b^{2} c^{9} d^{4} x + 1485 i b^{2} c^{8} d^{4} \right )}}{24} + \frac {\left (- 6 i b c^{2} d^{2} x^{2} - 8 b c d^{2} x + 3 i b d^{2}\right ) \log {\left (i c x + 1 \right )}}{24 x^{4}} + \frac {\left (6 i b c^{2} d^{2} x^{2} + 8 b c d^{2} x - 3 i b d^{2}\right ) \log {\left (- i c x + 1 \right )}}{24 x^{4}} - \frac {3 a d^{2} - 9 b c^{3} d^{2} x^{3} + x^{2} \left (- 6 a c^{2} d^{2} + 4 i b c^{2} d^{2}\right ) + x \left (8 i a c d^{2} + b c d^{2}\right )}{12 x^{4}} \]

[In]

integrate((d+I*c*d*x)**2*(a+b*atan(c*x))/x**5,x)

[Out]

-2*I*b*c**4*d**2*log(1485*b**2*c**9*d**4*x)/3 - I*b*c**4*d**2*log(1485*b**2*c**9*d**4*x - 1485*I*b**2*c**8*d**
4)/24 + 17*I*b*c**4*d**2*log(1485*b**2*c**9*d**4*x + 1485*I*b**2*c**8*d**4)/24 + (-6*I*b*c**2*d**2*x**2 - 8*b*
c*d**2*x + 3*I*b*d**2)*log(I*c*x + 1)/(24*x**4) + (6*I*b*c**2*d**2*x**2 + 8*b*c*d**2*x - 3*I*b*d**2)*log(-I*c*
x + 1)/(24*x**4) - (3*a*d**2 - 9*b*c**3*d**2*x**3 + x**2*(-6*a*c**2*d**2 + 4*I*b*c**2*d**2) + x*(8*I*a*c*d**2
+ b*c*d**2))/(12*x**4)

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.94 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\frac {1}{2} \, {\left ({\left (c \arctan \left (c x\right ) + \frac {1}{x}\right )} c + \frac {\arctan \left (c x\right )}{x^{2}}\right )} b c^{2} d^{2} + \frac {1}{3} i \, {\left ({\left (c^{2} \log \left (c^{2} x^{2} + 1\right ) - c^{2} \log \left (x^{2}\right ) - \frac {1}{x^{2}}\right )} c - \frac {2 \, \arctan \left (c x\right )}{x^{3}}\right )} b c d^{2} + \frac {1}{12} \, {\left ({\left (3 \, c^{3} \arctan \left (c x\right ) + \frac {3 \, c^{2} x^{2} - 1}{x^{3}}\right )} c - \frac {3 \, \arctan \left (c x\right )}{x^{4}}\right )} b d^{2} + \frac {a c^{2} d^{2}}{2 \, x^{2}} - \frac {2 i \, a c d^{2}}{3 \, x^{3}} - \frac {a d^{2}}{4 \, x^{4}} \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x))/x^5,x, algorithm="maxima")

[Out]

1/2*((c*arctan(c*x) + 1/x)*c + arctan(c*x)/x^2)*b*c^2*d^2 + 1/3*I*((c^2*log(c^2*x^2 + 1) - c^2*log(x^2) - 1/x^
2)*c - 2*arctan(c*x)/x^3)*b*c*d^2 + 1/12*((3*c^3*arctan(c*x) + (3*c^2*x^2 - 1)/x^3)*c - 3*arctan(c*x)/x^4)*b*d
^2 + 1/2*a*c^2*d^2/x^2 - 2/3*I*a*c*d^2/x^3 - 1/4*a*d^2/x^4

Giac [F]

\[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\int { \frac {{\left (i \, c d x + d\right )}^{2} {\left (b \arctan \left (c x\right ) + a\right )}}{x^{5}} \,d x } \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x))/x^5,x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.76 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.88 \[ \int \frac {(d+i c d x)^2 (a+b \arctan (c x))}{x^5} \, dx=\frac {d^2\,\left (9\,b\,c^3\,\mathrm {atan}\left (x\,\sqrt {c^2}\right )\,\sqrt {c^2}+b\,c^4\,\ln \left (c^2\,x^2+1\right )\,4{}\mathrm {i}-b\,c^4\,\ln \left (x\right )\,8{}\mathrm {i}\right )}{12}-\frac {\frac {d^2\,\left (3\,a+3\,b\,\mathrm {atan}\left (c\,x\right )\right )}{12}+\frac {d^2\,x\,\left (a\,c\,8{}\mathrm {i}+b\,c+b\,c\,\mathrm {atan}\left (c\,x\right )\,8{}\mathrm {i}\right )}{12}-\frac {d^2\,x^2\,\left (6\,a\,c^2+6\,b\,c^2\,\mathrm {atan}\left (c\,x\right )-b\,c^2\,4{}\mathrm {i}\right )}{12}-\frac {3\,b\,c^3\,d^2\,x^3}{4}}{x^4} \]

[In]

int(((a + b*atan(c*x))*(d + c*d*x*1i)^2)/x^5,x)

[Out]

(d^2*(b*c^4*log(c^2*x^2 + 1)*4i - b*c^4*log(x)*8i + 9*b*c^3*atan(x*(c^2)^(1/2))*(c^2)^(1/2)))/12 - ((d^2*(3*a
+ 3*b*atan(c*x)))/12 + (d^2*x*(a*c*8i + b*c + b*c*atan(c*x)*8i))/12 - (d^2*x^2*(6*a*c^2 - b*c^2*4i + 6*b*c^2*a
tan(c*x)))/12 - (3*b*c^3*d^2*x^3)/4)/x^4